import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.revwalk.FooterLine;
import org.eclipse.jgit.revwalk.RevCommit;

import java.io.File;
import java.util.List;

/**
 * Created by Kail on 2016/9/14.
 */
public class Main {

    private static final String PATH = "D:/git/jgit";


    private void init() throws GitAPIException {
        Git.init().setDirectory(new File(PATH)).call();
    }

    public static void main(String[] args) throws Exception {

        Git git = Git.init().setDirectory(new File(PATH)).call();

//        git.add().addFilepattern("123.txt").call();
//
//        git.commit().setMessage("ehehe").call();

        Iterable<RevCommit> call = git.log().call();
        for (RevCommit commit : call) {
            System.out.println(commit.toString());
            System.out.println(commit.getFullMessage());
        }

    }
}
